package cn.com.lms.business.learning.persistence.entity;

import io.swagger.v3.oas.annotations.media.Schema;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "bnz_learning_student", schema = "bnzj", catalog = "")
public class FbLearningStudent {
    private long id;
    private Long stageDetailId;
    private Long userId;
    @Schema(description = "姓名")
    private String userName;
    private String finishState;
    private Long planId;
    @Schema(description = "最近学习时间")
    private Date lastStudyTime;

    @Schema(description = "实际学时")
    private Integer studyTime;
    @Schema(description = "部门")
    private String deptName;
    private Integer sumNum;
    @Schema(description = "")
    private Integer finishOn;
    @Schema(description = "")
    private Integer finishOff;
    @Schema(description = "完成情况")
    private String completionStatus;

    @Schema(description = "已完成学时")
    private Integer learningHours;
    @Schema(description = "部门ID")
    private Long deptId;
    @Id
    @Column(name = "id")
    @GeneratedValue(
            strategy = GenerationType.IDENTITY
    )
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
    @Basic
    @Column(name = "dept_id")
    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    @Basic
    @Column(name = "stage_detail_id")
    public Long getStageDetailId() {
        return stageDetailId;
    }

    public void setStageDetailId(Long stageDetailId) {
        this.stageDetailId = stageDetailId;
    }

    @Basic
    @Column(name = "user_id")
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "finish_state")
    public String getFinishState() {
        return finishState;
    }

    public void setFinishState(String finishState) {
        this.finishState = finishState;
    }

    @Basic
    @Column(name = "plan_id")
    public Long getPlanId() {
        return planId;
    }

    public void setPlanId(Long planId) {
        this.planId = planId;
    }

    @Basic
    @Column(name = "last_study_time")
    public Date getLastStudyTime() {
        return lastStudyTime;
    }

    public void setLastStudyTime(Date lastStudyTime) {
        this.lastStudyTime = lastStudyTime;
    }

    @Basic
    @Column(name = "learning_hours")
    public Integer getLearningHours() {
        return learningHours;
    }

    public void setLearningHours(Integer learningHours) {
        this.learningHours = learningHours;
    }

    @Transient
    public Integer getStudyTime() {
        return studyTime;
    }

    public void setStudyTime(Integer studyTime) {
        this.studyTime = studyTime;
    }

    @Basic
    @Column(name = "dept_name")
    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @Transient
    public Integer getSumNum() {
        return sumNum;
    }

    public void setSumNum(Integer sumNum) {
        this.sumNum = sumNum;
    }

    @Transient
    public Integer getFinishOn() {
        return finishOn;
    }

    public void setFinishOn(Integer finishOn) {
        this.finishOn = finishOn;
    }

    @Transient
    public Integer getFinishOff() {
        return finishOff;
    }

    public void setFinishOff(Integer finishOff) {
        this.finishOff = finishOff;
    }

    @Transient
    public String getCompletionStatus() {
        return completionStatus;
    }

    public void setCompletionStatus(String completionStatus) {
        this.completionStatus = completionStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FbLearningStudent student = (FbLearningStudent) o;
        return id == student.id &&
                Objects.equals(stageDetailId, student.stageDetailId) &&
                Objects.equals(userId, student.userId) &&
                Objects.equals(userName, student.userName) &&
                Objects.equals(finishState, student.finishState) &&
                Objects.equals(planId, student.planId) &&
                Objects.equals(lastStudyTime, student.lastStudyTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, stageDetailId, userId, userName, finishState, planId, lastStudyTime);
    }
}
